package zuoye01;

import java.util.Scanner;

public class Lookup {

	public static void main(String[] args) {
		Scanner input=new Scanner(System.in);
		System.out.println("请输入一个字符串：");
		String str=input.next();
		System.out.println("请输入要查找的字符：");
		String str2=input.next();
		int count=0;
		for (int i = 0; i < str.length(); i++) {
			String s=str.substring(i,i+1);
			if(str2.equals(s)) {
				count++;
			}
		}
		System.out.println(count);
		}

	}


